<template>
  <img
    v-if="name"
    class="v-align-m server-image"
    :class="className"
    :src="require('@/assets/img/'+name)"
    :mode="mode" />
  <img
    v-else
    class="v-align-m server-image"
    :class="className"
    :src="require('@/assets/img/logo.png')"
    mode="aspectFill" />
</template>

<script>
  import config from '@/api/config.js';
  // 多模板图片组件
  export default {
    name: 'server-image',
    props: {
      className: {
        type: String,
        default: ''
      },
      name: {
        type: String,
        default: ''
      },
      mode: {
        type: String,
        default: 'aspectFill',
      }
    },
    data() {
      return {
        // src: '',
        imagePrefix: config.imagePrefix,
      }
    },
    created(){

    }

  }

</script>

<style lang="less" scoped>
.server-image{
  width: 100%;
  height: 100%;
  display: block;
}
</style>
